/*
 * main_client.cpp
 *
 *  Created on: Jan 12, 2009
 *      Author: tandaica0612
 */
#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string>
using namespace std;
/*
int main(int argc,char* args[]){
	 //
	 // Co che' hoat. dong. cua? client theo co che' TCP :
	 // 1.socket()
	 // 2.connect()
	 // 3.write()
	 // 4.read()
	 // 5.close()
	 // Chu'y' , buoc' 3,4 co' the? lap. vo han.
	 //
	int m_sock = socket(AF_INET,SOCK_STREAM,0);
	sockaddr_in client_addr;
	//
	client_addr.sin_family = AF_INET;
	client_addr.sin_port = htons(6324);
	//
	int status = inet_pton(AF_INET,"127.0.0.1",&client_addr.sin_addr);
	connect(m_sock,(struct sockaddr*)&client_addr,sizeof(client_addr));
	//
	string client_request = "Hello , I am client ^^!";
	send(m_sock,client_request.c_str(),client_request.size(),0);
	//
	int sizebuf = 500;
	char buf[sizebuf+1];
	int isok = recv(m_sock,buf,sizebuf,0);
	if(isok != -1){
		cout << "server > " << buf << endl;
	}
}
**/
